package com.bjdd.jdy.ui.commitCard;

import com.bjdd.jdy.base.BaseResult;
import com.bjdd.jdy.entity.ProvinceBean;
import com.bjdd.jdy.entity.ToolBean;
import com.bjdd.jdy.entity.User;
import com.bjdd.jdy.util.Api;
import com.bjdd.jdy.util.L;
import com.bjdd.jdy.util.RxSchedulers;

import java.util.List;
import java.util.Map;

import okhttp3.RequestBody;
import rx.Observable;

/**
 * Created by Administrator on 2017/4/10.
 */

public class CommitModel implements CommitContract.Model {


    @Override
    public Observable<BaseResult<String>> getCommitModel(String token, Map<String, String> params, Map<String, RequestBody> photos) {
        return Api.getInstance().service
                .submitInfo(token,params,photos)
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<BaseResult<List<ProvinceBean>>> getAreaModel(String token) {
        L.d("in model");
        return Api.getInstance().service
                .getArea(token)
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<BaseResult<List<ToolBean>>> getTools(String token) {
        return Api.getInstance().service
                .getTools(token)
                .compose(RxSchedulers.io_main());
    }
}
